#include<stdio.h>
#include<math.h>
int main()
{
    long long int n,m,q;
    long long int zu;    
    long long int i = 1;
    scanf("%lld%lld%lld",&n,&m,&q);
    while(1)
    {
        n-=i;
        m-=i;
        if(n<0||m<0)
        {
            n+=i;
            m+=i;
            i--;
            break;
        }
        i++;
    }
    if(n>m)
    {
        if(q>=(n-m))
        {        
            zu = (q-(n-m))/2;
            n = n+zu;
            m = n;
        }
    }
    else if(n<m)
    {
        if(q>=(m-n))
        {
            zu = (q-(m-n))/2;
            m = m+zu;
            n = m;
        }
    }
    else
    {
        zu = q/2;
        m = m+zu;
        n = m;
    }
    i+=1;
    while(1)
    {
        n-=i;
        m-=i;
        if(n<0||m<0)
        {
            i--;
            break;
        }
        i++;
    }
    printf("%lld",i);
    return 0;
}